Package-level declarations

Types

Link copied to clipboard
data class BarChartData(val label: String, val value: Float, val segments: List<BarChartSegment> = emptyList())

Data for a single bar (category) in a SimpleBarChart.

Link copied to clipboard
data class BarChartSegment(val value: Float, val color: Color)

A single segment within a stacked bar, representing one sub-category's contribution to the bar's total height.

Link copied to clipboard
data class LineChartData(val label: String, val value: Float)

A single data point in a SimpleLineChart, pairing an X-axis label with a numeric Y value.

Link copied to clipboard
data class PieChartData(val label: String, val value: Float, val color: Color)

A single slice of a pie or donut chart, pairing a categorical label with its numeric magnitude and display color.

Link copied to clipboard
data class StylishAreaPoint(val label: String, val value: Float)

A labelled value rendered by StylishAreaChart.

Link copied to clipboard
sealed interface StylishChartAction

Pure actions accepted by StylishChartState.reduce.

Link copied to clipboard
data class StylishChartSelection(val seriesIndex: Int, val pointIndex: Int)

A selected point, addressed by series and category indexes.

Link copied to clipboard
data class StylishChartState(val selection: StylishChartSelection? = null, val visibleSeriesNames: Set<String> = emptySet())

Hoisted interaction state for StylishMultiSeriesLineChart.

Link copied to clipboard

Shared pure reducer used by Compose, SwiftUI, Web, and desktop host stores.

Link copied to clipboard
data class StylishLineSeries(val name: String, val values: List<Float>, val color: Color)

One named line in StylishMultiSeriesLineChart.

Link copied to clipboard
data class StylishScatterPoint(val label: String, val value: Float)

A single point rendered by StylishScatterChart.

Functions

Link copied to clipboard
fun DrawScope.drawTopRoundedRect(color: Color, left: Float, top: Float, width: Float, height: Float, radius: Float)

Draws a rectangle whose only the top-left and top-right corners are rounded, leaving the bottom edge square.

Link copied to clipboard

Returns the next chart interaction state without coupling state to Compose.

Link copied to clipboard
fun SimpleBarChart(data: List<BarChartData>, contentDescriptionPrefix: String, emptyLabel: String, modifier: Modifier = Modifier, barColor: Color = MaterialTheme.colorScheme.primary, gridColor: Color = MaterialTheme.colorScheme.outlineVariant, chartHeight: Dp = StylishTheme.dimensions.barChartHeight, topRadius: Dp = 4.dp, labelTextSize: Dp = 10.dp, gridLineCount: Int = 4, animate: Boolean = true)

A vertical bar chart with optional stacked segments, rendered on a Compose Canvas for lightweight, dependency-free drawing.

Link copied to clipboard
fun SimpleLineChart(data: List<LineChartData>, contentDescriptionPrefix: String, emptyLabel: String, modifier: Modifier = Modifier, lineColor: Color = MaterialTheme.colorScheme.primary, fillColor: Color = MaterialTheme.colorScheme.primary.copy(alpha = 0.1f), pointColor: Color = MaterialTheme.colorScheme.primary, gridColor: Color = MaterialTheme.colorScheme.outlineVariant, chartHeight: Dp = StylishTheme.dimensions.lineChartHeight, strokeWidth: Dp = 2.5.dp, pointRadius: Dp = 4.dp, pointInnerRadius: Dp = 2.dp, labelTextSize: Dp = 10.dp, gridLineCount: Int = 5, maxLabelCount: Int = 6, animate: Boolean = true)

A line chart with area fill, grid lines, data-point markers, and categorical X-axis labels, rendered on a Compose Canvas.

Link copied to clipboard
fun SimplePieChart(data: List<PieChartData>, contentDescriptionPrefix: String, modifier: Modifier = Modifier, chartSize: Dp = StylishTheme.dimensions.pieChartSize, holeRatio: Float = 0.3f, skeletonRatio: Float = 0.4f, holeColor: Color = MaterialTheme.colorScheme.surface, skeletonColor: Color = MaterialTheme.colorScheme.outlineVariant, startAngle: Float = -90f, animate: Boolean = true)

A lightweight donut-style pie chart rendered entirely on a Canvas.

Link copied to clipboard
fun StylishAreaChart(points: List<StylishAreaPoint>, contentDescription: String, modifier: Modifier = Modifier, chartHeight: Dp = StylishTheme.dimensions.lineChartHeight, color: Color = MaterialTheme.colorScheme.primary)

Renders a filled area chart using the same scale rules as the line chart. Invalid points break the path rather than connecting through missing data.

Link copied to clipboard

Returns a color from the theme's categorical chart palette by index.

Link copied to clipboard
fun StylishMultiSeriesLineChart(labels: List<String>, series: List<StylishLineSeries>, contentDescriptionPrefix: String, state: StylishChartState, onStateChange: (StylishChartState) -> Unit, modifier: Modifier = Modifier)

Controlled overload using StylishChartState. The reducer-backed state can be persisted or shared with a store while the renderer remains the same.

fun StylishMultiSeriesLineChart(labels: List<String>, series: List<StylishLineSeries>, contentDescriptionPrefix: String, modifier: Modifier = Modifier, selection: StylishChartSelection? = null, onSelectionChange: (StylishChartSelection?) -> Unit? = null, chartHeight: Dp = StylishTheme.dimensions.lineChartHeight, gridColor: Color = MaterialTheme.colorScheme.outlineVariant, strokeWidth: Dp = 2.5.dp, showLegend: Boolean = true, tooltip: @Composable (label: String, series: StylishLineSeries, value: Float) -> Unit? = null, visibleSeriesNames: Set<String> = series.map { it.name }.toSet(), onVisibleSeriesNamesChange: (Set<String>) -> Unit? = null, xAxisLabel: String? = null, yAxisLabel: String? = null, valueFormatter: (Float) -> String? = null, yAxisTickCount: Int = 5, showAxisTicks: Boolean = false, xAxisTickFormatter: (String) -> String = { it }, yAxisTickFormatter: (Float) -> String = { valueFormatter?.invoke(it) ?: it.toString() })

Multi-series line chart with a horizontally scrollable legend and tap selection tooltip. Non-finite values are skipped. Series may be shorter than labels; missing points are empty.

Link copied to clipboard
fun StylishScatterChart(points: List<StylishScatterPoint>, contentDescription: String, modifier: Modifier = Modifier, chartHeight: Dp = StylishTheme.dimensions.lineChartHeight, color: Color = MaterialTheme.colorScheme.primary, pointRadius: Dp = 5.dp)

Renders independent points rather than connecting them with a line. Non-finite values are skipped and the accessibility description retains all finite points.